﻿using System;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.Action.SPI
{
    /// <summary>
    /// TSchema构造器
    /// </summary>
    public interface ITSchemaBuilder
    {
        /// <summary>
        /// 根据数据结构返回TSchema
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="tsType">TSchema转换来源类型</param>
        /// <param name="data">数据</param>
        /// <returns></returns>
        TSchema ConvertToTSchema<T>(TSchemaConvertType tsType, T data);
        /// <summary>
        /// 根据指定元数据ID获取返回TSchema
        /// </summary>
        /// <param name="tsType">TSchema转换来源类型</param>
        /// <param name="metadataID">元数据ID</param>
        /// <returns></returns>
        TSchema ConvertToTSchema(TSchemaConvertType tsType,string metadataID);
    }
}
